package xhwl.insurance.ui;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.umeng.socialize.utils.Log;

import xhwl.insurance.BaseActivity;
import xhwl.insurance.R;

/**
 * Created by Administrator on 2017/8/24.
 * 用户指南详情
 */

public class UserGudieDetailActivity extends BaseActivity {

    private String title;
    private WebView webview;
    private String url;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = getIntent();
        title = intent.getStringExtra("title");
        url = intent.getStringExtra("url");
        Log.i("824",title+"============"+url);
        setContentView(R.layout.activity_user_guide_detail);

    }

    @Override
    public void initViews() {
        initTitleViews();
        webview = (WebView) findViewById(R.id.webview);
        WebSettings webSettings = webview.getSettings();
        //设置WebView属性，能够执行Javascript脚本
        webSettings.setJavaScriptEnabled(true);
        //设置可以访问文件
        webSettings.setAllowFileAccess(true);
        //设置支持缩放
        webSettings.setBuiltInZoomControls(true);
        //设置Web视图
        webview.setWebViewClient(new webViewClient());

    }
        //Web视图
    private class webViewClient extends WebViewClient {
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        }
    @Override
    public void initListener() {

    }
    @Override
    protected void setUpTitleView() {
        titleTextView.setText(title);
    }
    @Override
    public void loadData() {

        webview.loadUrl(url);

    }

}
